class_name Player extends Node

var alive = true
var is_me = false
var username:String
var color:Color = Color.WHITE
var small:Small
var map_bigs = Dictionary()
var is_beSmelling = false			#正在被明魂搜根
var is_looking = false				#正在天眼传真

func _ready():
	pass 

func init(obj,index:int):
	username = obj.username
	color = GameUtils.getColorByInt(index)
	is_me = !ObjectManager.is_replay && username == ObjectManager.myUserInfo.username
	if is_me:
		ObjectManager.gameManager.me_player = self
	var point_id = obj.small.point_id
	var gameManager = ObjectManager.gameManager as GameManager
	var point = gameManager.map_points.get(point_id)
	small = gameManager.pre_small.instantiate()
	gameManager.layer_chesses.add_child(small)
	small.init(self,point)

func turnStart():
	for big in map_bigs.values():
		big.turnStart()
